<!DOCTYPE html>
<html lang="en">
<head>
<title>WebView4Delphi: uWVTypeLibrary: Interface ICoreWebView2Frame</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="PasDoc 0.16.0-snapshot">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<span id="ICoreWebView2Frame"></span><h1 class="cio">Interface ICoreWebView2Frame</h1>
<div class="sections">
<div class="one_section"><a class="section" href="#PasDoc-Description">Description</a></div><div class="one_section"><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></div><div class="one_section">Fields</div><div class="one_section"><a class="section" href="#PasDoc-Methods">Methods</a></div><div class="one_section">Properties</div></div>
<span id="PasDoc-Description"></span><h2 class="unit">Unit</h2>
<p class="unitlink">
<a href="uWVTypeLibrary.html">uWVTypeLibrary</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type ICoreWebView2Frame = interface(IUnknown)</code></p>
<h2 class="description">Description</h2>
<p>
 ICoreWebView2Frame provides direct access to the iframes information. You can get an ICoreWebView2Frame by handling the ICoreWebView2_4.add_FrameCreated event. </p>
<p>


<p>&lt;see href=&quot;<a href="https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2frame">https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2frame</a>&quot;&gt;See the ICoreWebView2Frame article.)</p>
<span id="PasDoc-Hierarchy"></span><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">IUnknown</li>
<li class="thisitem">ICoreWebView2Frame</li></ul><h2 class="overview">Overview</h2>
<span id="PasDoc-Methods"></span><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Frame.html#Get_name-PWideChar-">Get_name</a></strong>(out name: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Frame.html#add_NameChanged-ICoreWebView2FrameNameChangedEventHandler-EventRegistrationToken-">add_NameChanged</a></strong>(const eventHandler: <a href="uWVTypeLibrary.ICoreWebView2FrameNameChangedEventHandler.html">ICoreWebView2FrameNameChangedEventHandler</a>; out token: <a href="uWVTypeLibrary.EventRegistrationToken.html">EventRegistrationToken</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Frame.html#remove_NameChanged-EventRegistrationToken-">remove_NameChanged</a></strong>(token: <a href="uWVTypeLibrary.EventRegistrationToken.html">EventRegistrationToken</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Frame.html#AddHostObjectToScriptWithOrigins-PWideChar-OleVariant-SYSUINT-PWideChar-">AddHostObjectToScriptWithOrigins</a></strong>(name: PWideChar; const object_: OleVariant; originsCount: SYSUINT; var origins: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Frame.html#RemoveHostObjectFromScript-PWideChar-">RemoveHostObjectFromScript</a></strong>(name: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Frame.html#add_Destroyed-ICoreWebView2FrameDestroyedEventHandler-EventRegistrationToken-">add_Destroyed</a></strong>(const eventHandler: <a href="uWVTypeLibrary.ICoreWebView2FrameDestroyedEventHandler.html">ICoreWebView2FrameDestroyedEventHandler</a>; out token: <a href="uWVTypeLibrary.EventRegistrationToken.html">EventRegistrationToken</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Frame.html#remove_Destroyed-EventRegistrationToken-">remove_Destroyed</a></strong>(token: <a href="uWVTypeLibrary.EventRegistrationToken.html">EventRegistrationToken</a>): HResult; stdcall;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>function <strong><a href="uWVTypeLibrary.ICoreWebView2Frame.html#IsDestroyed-Integer-">IsDestroyed</a></strong>(out destroyed: Integer): HResult; stdcall;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Get_name-PWideChar-"></span><code>function <strong>Get_name</strong>(out name: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 The value of iframe's window.name property. The default value equals to iframe html tag declaring it. You can access this property even if the iframe is destroyed.

<p>The caller must free the returned string with `CoTaskMemFree`. See [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings). </p>
<h6 class="description_section">Attributes</h6>
<dl class="attributes">
  <dt>GUID['{F1131A5E-9BA9-11EB-A8B3-0242AC130003}']</dt>
  <dd></dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="add_NameChanged-ICoreWebView2FrameNameChangedEventHandler-EventRegistrationToken-"></span><code>function <strong>add_NameChanged</strong>(const eventHandler: <a href="uWVTypeLibrary.ICoreWebView2FrameNameChangedEventHandler.html">ICoreWebView2FrameNameChangedEventHandler</a>; out token: <a href="uWVTypeLibrary.EventRegistrationToken.html">EventRegistrationToken</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Raised when the iframe changes its window.name property. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="remove_NameChanged-EventRegistrationToken-"></span><code>function <strong>remove_NameChanged</strong>(token: <a href="uWVTypeLibrary.EventRegistrationToken.html">EventRegistrationToken</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Remove an event handler previously added with add_NameChanged. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="AddHostObjectToScriptWithOrigins-PWideChar-OleVariant-SYSUINT-PWideChar-"></span><code>function <strong>AddHostObjectToScriptWithOrigins</strong>(name: PWideChar; const object_: OleVariant; originsCount: SYSUINT; var origins: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Add the provided host object to script running in the iframe with the specified name for the list of the specified origins. The host object will be accessible for this iframe only if the iframe's origin during access matches one of the origins which are passed. The provided origins will be normalized before comparing to the origin of the document. So the scheme name is made lower case, the host will be punycode decoded as appropriate, default port values will be removed, and so on. This means the origin's host may be punycode encoded or not and will match regardless. If list contains malformed origin the call will fail. The method can be called multiple times in a row without calling RemoveHostObjectFromScript for the same object name. It will replace the previous object with the new object and new list of origins. List of origins will be treated as following: 1. empty list - call will succeed and object will be added for the iframe but it will not be exposed to any origin; 2. list with origins - during access to host object from iframe the origin will be checked that it belongs to this list; 3. list with &quot;*&quot; element - host object will be available for iframe for all origins. We suggest not to use this feature without understanding security implications of giving access to host object from from iframes with unknown origins. 4. list with &quot;<a href="file://">file://</a>&quot; element - host object will be available for iframes loaded via file protocol. Calling this method fails if it is called after the iframe is destroyed. \snippet ScenarioAddHostObject.cpp AddHostObjectToScriptWithOrigins For more information about host objects navigate to ICoreWebView2::AddHostObjectToScript. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="RemoveHostObjectFromScript-PWideChar-"></span><code>function <strong>RemoveHostObjectFromScript</strong>(name: PWideChar): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Remove the host object specified by the name so that it is no longer accessible from JavaScript code in the iframe. While new access attempts are denied, if the object is already obtained by JavaScript code in the iframe, the JavaScript code continues to have access to that object. Calling this method for a name that is already removed or was never added fails. If the iframe is destroyed this method will return fail also. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="add_Destroyed-ICoreWebView2FrameDestroyedEventHandler-EventRegistrationToken-"></span><code>function <strong>add_Destroyed</strong>(const eventHandler: <a href="uWVTypeLibrary.ICoreWebView2FrameDestroyedEventHandler.html">ICoreWebView2FrameDestroyedEventHandler</a>; out token: <a href="uWVTypeLibrary.EventRegistrationToken.html">EventRegistrationToken</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 The Destroyed event is raised when the iframe corresponding to this CoreWebView2Frame object is removed or the document containing that iframe is destroyed. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="remove_Destroyed-EventRegistrationToken-"></span><code>function <strong>remove_Destroyed</strong>(token: <a href="uWVTypeLibrary.EventRegistrationToken.html">EventRegistrationToken</a>): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Remove an event handler previously added with add_Destroyed. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img  src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="IsDestroyed-Integer-"></span><code>function <strong>IsDestroyed</strong>(out destroyed: Integer): HResult; stdcall;</code></td>
</tr>
<tr><td colspan="2">
<p>
 Check whether a frame is destroyed. Returns true during the Destroyed event. </p>
</td></tr>
</table>
<hr><span class="appinfo"><em>Generated by <a href="https://pasdoc.github.io/">PasDoc 0.16.0-snapshot</a>. </em>
</span>
</body></html>
